﻿using System.Web.Mvc;
using IterationLife.Extensions.MvcApi;
using IterationLife.Mobile.AppServices.Services.Football;
using Util;
using Util.Domains.Contexts;

namespace IterationLife.Mobile.ApiGateway.Areas.Football.Controllers
{
    [MvcApiAuthorize]
    public class DeviceController : MvcApiController
    {
        private IFootballDeviceService _footballDeviceService;
        public DeviceController(IFootballDeviceService footballDeviceService)
        {
            _footballDeviceService = footballDeviceService;
        }

        [HttpPost]
        public ActionResult BindMTSportsAccount(string account, string password)
        {
            var data=_footballDeviceService.BindingMTSportsAccount(account,password);
            return Ok(data);
        }

        [HttpGet]
        public ActionResult GetBindedDevices()
        {
            var data = _footballDeviceService.GetUserBindedDevices(ApplicationContext.User.UserId.ToGuid());
            return Ok(data);
        }
    }
}